/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view.employee;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import view.Login;

/**
 *
 * @author khangpm
 */
public class EmployeeManage extends javax.swing.JPanel {
    BillView BillView;
    /**
     * Creates new form AdministratorManage
     */
    public EmployeeManage() {
        initComponents();
        panelEmpHome.removeAll();
        BillView = new BillView();
        BillView.setBounds(10, 0, 750, 510);
        panelEmpHome.add(BillView);
    }

    /**
     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jToolBar1 = new javax.swing.JToolBar();
        btnHome = new javax.swing.JButton();
        btnAddnew = new javax.swing.JButton();
        panelEmpHome = new javax.swing.JPanel();

        setBackground(new java.awt.Color(255, 255, 255));
        setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        setMinimumSize(new java.awt.Dimension(770, 590));
        setPreferredSize(new java.awt.Dimension(770, 590));

        jToolBar1.setRollover(true);
        jToolBar1.setEnabled(false);

        btnHome.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        btnHome.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/home.png"))); // NOI18N
        btnHome.setText("Home");
        btnHome.setFocusable(false);
        btnHome.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btnHome.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHomeActionPerformed(evt);
            }
        });
        jToolBar1.add(btnHome);

        btnAddnew.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        btnAddnew.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/buttonAdd.png"))); // NOI18N
        btnAddnew.setText("Add new");
        btnAddnew.setFocusable(false);
        btnAddnew.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btnAddnew.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddnewActionPerformed(evt);
            }
        });
        jToolBar1.add(btnAddnew);

        panelEmpHome.setMinimumSize(new java.awt.Dimension(770, 590));
        panelEmpHome.setPreferredSize(new java.awt.Dimension(770, 590));

        javax.swing.GroupLayout panelEmpHomeLayout = new javax.swing.GroupLayout(panelEmpHome);
        panelEmpHome.setLayout(panelEmpHomeLayout);
        panelEmpHomeLayout.setHorizontalGroup(
            panelEmpHomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        panelEmpHomeLayout.setVerticalGroup(
            panelEmpHomeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 590, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 770, Short.MAX_VALUE)
            .addComponent(panelEmpHome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelEmpHome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btnHomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHomeActionPerformed
        // TODO add your handling code here:
        panelEmpHome.removeAll();
        panelEmpHome.add(BillView);
        panelEmpHome.updateUI();
    }//GEN-LAST:event_btnHomeActionPerformed

    private void btnAddnewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddnewActionPerformed
        // TODO add your handling code here:
        panelEmpHome.removeAll();
        BillAddNew billAddNew = new BillAddNew();
        billAddNew.setBounds(10, 0, 750, 510);
        panelEmpHome.add(billAddNew);
        panelEmpHome.updateUI();
    }//GEN-LAST:event_btnAddnewActionPerformed
    
    @Override
    public void paintComponent(Graphics g)
    {
        try {
            Dimension d = getSize();
            Image img = ImageIO.read(getClass().getResource("/images/background1.jpg"));
            g.drawImage(img, 0, 0, d.width, d.height, this);
            setOpaque(false);  // lam trong suot
            super.paintComponent(g);
        } catch (IOException ex) {
            Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAddnew;
    private javax.swing.JButton btnHome;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JPanel panelEmpHome;
    // End of variables declaration//GEN-END:variables
}
